package com.createidea.scrumfriend.struts.action;

import java.util.List;

import org.apache.struts2.json.annotations.JSON;

import com.createidea.scrumfriend.service.story.StoryService;
import com.createidea.scrumfriend.service.user.UserService;
import com.createidea.scrumfriend.to.StoryTo;

public class StoryAction extends BaseAction {
	
	private StoryService storyService;	
	private StoryTo story;
	private String projectId;
	private List<StoryTo> stories;
	
	
	public String loadCreateStory(){
		return SUCCESS;
	}
	
	public String createStory(){
		storyService.createStory(story,projectId);
		return SUCCESS;
	}
	
	public String listStories(){
		stories=storyService.getStoriesForProject(projectId);
		
		return SUCCESS;
	}
	/*
	 * set & get methods
	 */
	
	
	public StoryService getStoryService() {
		return storyService;
	}
	
	public void setStoryService(StoryService storyService) {
		this.storyService = storyService;
	}

	
	
	public StoryTo getStory() {
		return story;
	}
	
	public void setStory(StoryTo story) {
		this.story = story;
	}
	
	public String getProjectId() {
		return projectId;
	}
	
	public void setProjectId(String projectId) {
		this.projectId = projectId;
	}
	
	public List<StoryTo> getStories() {
		return stories;
	}
	
	public void setStories(List<StoryTo> stories) {
		this.stories = stories;
	}
	
	
	
	
}
